home *** CD-ROM | disk | FTP | other *** search
/ Intel Web Outfitter Tool Kit 4 / Intel WebOutfitter Tool Kit Version 4.0.iso / public / Content / HAPTEK / CHS / CONTENT / vf3.js < prev    next >
Encoding:
JavaScript  |  2000-03-13  |  17.8 KB  |  709 lines

  1. ////////////////////////////////////////////////////////////////////
  2. // vf3.js Version 2 (August 19th, 1999)
  3. // -----------------------------------------------------------------
  4. // (c) 1999 Haptek, Inc.
  5.  
  6.  
  7. ////////////////////////////////////////////////////////////////////
  8. // Function QuickRef
  9. // -----------------------------------------------------------------
  10. // (parameters surrouned by braces, [], are optional)
  11. // See the note below about the 'code' parameter.
  12. //
  13. //
  14. // SendText(text[,box]) - sends 'text' to hypertext interpreter of plugin 
  15. // HapQuery(text[,box]) - ditto w/ query
  16. // VFBoxSelect(box) - selects a plugin instance to send commands to
  17. // VFBox(x, y[,commandfile]) - draws a box on the page x by y. Optionaly a local command file can be included
  18. // UseVFE(DLFN, code) - downloads and loads a VFE (if code is not specified, loads a local file, see src)
  19. // UseFile(DLFN, code) - ditto , w/ file
  20. // UseBackground(DLFN, code) - ditto w/ background
  21. // UseTexture(DLFN, code) - ditto w/ texture
  22. // UseMorph(morph [, code]) - ditto w/ morph If no code, then uses a standard morph. Downloading not tested!
  23. // UseNaturalVoice(DLFNwav, DLFNphn, code) - ditto w/ sound and phn file.
  24. // StartFile(thefile) - performs the \start hypertext command on 'thefile'
  25. // GrabFile(DLFN, code) - downloads a file (good for putting things in cache)
  26. // CleanUp([box]) - performs the \cleanup hypertext command
  27. // SetMaterial(i0, f0, f1, f2, f3) - changes material i0 w/ the f* values
  28. // SetAmbient(r, g, b, a) -
  29. // SetDiffuse(r, g, b, a) - 
  30. // SetEmissive(r, g, b, a) -
  31. // SetSpecular(r, g, b, a) -
  32. // SetSpecularPower(power) - 
  33. // Rotate(x, y, z, t) - just like the hypertext
  34. // Translate(x, y, z, t) - just like the hypertext
  35. // AddInitFile(box, name) - adds a scene file to be loaded to the vf 'box' as soon as the page is loaded
  36. // AddToInitQueue(string[,box]) - adds a string of javascript to be eval'ed as soon as the plugin is ready. 
  37. // HAPOnLoadInit() - function that must be put in the <BODY onLoad=> tag
  38. //
  39. // About the 'code' parameter:
  40. // 
  41. //   'code' is a way of specifying what sort of filename you have passed to 
  42. //   the downloading functions:
  43. //   'R'    Filename is relative to current webpage (ex: mybackground.jpg)
  44. //   'A'    Absolute URL or filename (ex: http://www.haptek.com/texture/tex.jhp)
  45. //   'DB1'    DB1 is a repository of most of Haptek's textures (ex: head/mapBaba512.jhp)
  46.  
  47. function SendText(text, box)
  48. {
  49.     // check if optional parameter was passed
  50.     if(box) boxofchoice = box;
  51.     else boxofchoice = G_PluginCurrent;
  52.  
  53.     if(G_PluginOkay) {
  54.         var shortText = text.substr(0, 1400);
  55.         if(G_BrowserNavigator)
  56.             eval("document.embeds['"+G_VFBoxes[boxofchoice].name+"'].HyperText(shortText);");
  57.         if(G_BrowserExplorer)
  58.             eval("document."+G_VFBoxes[boxofchoice].name+".HyperText = shortText;");
  59.     }
  60.       if(G_Debugger)
  61.         window.document.debug.outputbox.value = shortText + "\n" + window.document.debug.outputbox.value;
  62. }
  63.  
  64. function HapQuery(text, box)
  65. {
  66.     // check if optional parameter was passed
  67.     if(box) boxofchoice = box;
  68.     else boxofchoice = G_PluginCurrent;
  69.  
  70.     rtn = "";
  71.     if(G_PluginOkay) {
  72.          var shortText = text.substr(0, 1400);
  73.         if(G_BrowserNavigator)
  74.             eval("rtn = document.embeds['"+G_VFBoxes[boxofchoice].name+"'].QueryPlugin(shortText);");
  75.         if(G_BrowserExplorer)
  76.         {
  77.             eval("document."+G_VFBoxes[boxofchoice].name+".Query = shortText;");
  78.             eval("rtn = document."+G_VFBoxes[boxofchoice].name+".Query");
  79.         }
  80.     }
  81.     if(G_Debugger)
  82.         window.document.debug.outputbox.value = "A: " + rtn + "\nQ: " +shortText +"\n"+ window.document.debug.outputbox.value;
  83.     return rtn;
  84. }
  85.  
  86. function VFBoxSelect(box)
  87. {
  88.     G_PluginCurrent = box;
  89. }
  90.  
  91. function VFBox(x, y, commandfile)
  92. {
  93.     G_PluginNum++;
  94.     G_VFBoxes[G_PluginNum]       = new Object();
  95.     G_VFBoxes[G_PluginNum].name  = "vfbox" + G_PluginNum;
  96.     G_VFBoxes[G_PluginNum].path  = 'document';
  97.     G_VFBoxes[G_PluginNum].sizex = x;
  98.      G_VFBoxes[G_PluginNum].sizey = y;
  99.  
  100.     // exception to start the version testing
  101.     if(G_PluginNum == 1) AddToInitQueue("SafeQuery();");
  102.  
  103.     // check to see if an external command file is specified
  104.     if (commandfile)     
  105.         G_VFBoxes[G_PluginNum].scene = JustFile(commandfile);
  106.     else     
  107.         G_VFBoxes[G_PluginNum].scene = 'data\\standard\\standardStartup.hap';
  108.  
  109.     
  110.  
  111.     if (G_PluginOkay) 
  112.     {
  113.         
  114.         if (G_BrowserNavigator) 
  115.         {
  116.             document.write("<EMBED type=\""+G_HAPMimeType+"\" name=\""+ G_VFBoxes[G_PluginNum].name+"\" width=\""+x+"\" height=\""+y+"\" border= \"0\" vspace= \"0\" hspace=\"0\"></EMBED>");
  117.         }
  118.         else 
  119.         {
  120.              document.write("\
  121.             <OBJECT id=\""+ G_VFBoxes[G_PluginNum].name + "\" classid=\""+G_HAPCLSID+"\"\
  122.             align=\"baseline\" border=\"0\" width=\""+x+"\" height=\""+y+"\">\
  123.             </OBJECT>\
  124.             ");
  125.         }
  126.     }
  127.     else 
  128.     {
  129.         if(G_NoVF3Image)
  130.         {
  131.             document.write("<img src="+G_NoVF3Image+" WIDTH="+x+" HEIGHT="+y+">");
  132.         }
  133.         else
  134.         {
  135.             document.write("<table width="+x+" height="+y+" border=2 bordercolor=\"#0000ee\"><tr><td><font size=-1>");
  136.             document.write("╖╟│ú▒º╟╕ú¼─·╨Φ╥¬ VirtualFriend 3 ╡─╫ε╨┬░µ▒╛╥╘▒π╘┌╒Γ└∩Σ»└└ VirtualFriend ╫╓╖√íú╚τ╣√─·╡Ñ╗≈<a href=\"http://vf3.haptek.com\">╒Γ└∩</a>ú¼─·┐╔┤╙ Haptek, Inc ╧┬╘╪╦ⁿíú");
  137.             document.write("</font></td></tr></table>");
  138.         }
  139.       }
  140.  
  141.     VFBoxSelect(G_PluginNum);
  142.  
  143.     if(commandfile == "none") return;
  144.  
  145.     if(commandfile)    
  146.     {
  147.         commandfile = Backslashify(commandfile);
  148.         selectbox   = "VFBoxSelect("+G_PluginNum+");"
  149.         usefile     = "UseFile('"+commandfile+"', 'A');";
  150.         AddToInitQueue(selectbox);
  151.         AddToInitQueue(usefile);
  152.     }
  153.     else
  154.     {
  155.         AddToInitQueue("SendText('\\\\load [file= "+G_HAP_LangScene+"]')");
  156.         AddToInitQueue("SendText('\\\\load [file= "+G_HAP_LangPose+"]')");
  157.     }
  158.  
  159.  
  160.  
  161. }
  162.  
  163. function UseVFE(DLFN, code)
  164. {
  165.     UseFile(DLFN, code);
  166. }
  167.  
  168. function UseFile(DLFN, code)
  169. {
  170.     if(code)
  171.     {
  172.         if    (code == "A"    )
  173.             DLURL    =    ""        + DLFN;
  174.         else if    (code == "R"    )
  175.             DLURL    =    G_PageRoot    + DLFN;
  176.         else if    (code == "DB1"    )
  177.             DLURL    =    G_DB1        + DLFN;
  178.  
  179.         fn    =    JustFile(DLFN);
  180.         grp    =    GetGrp();
  181.  
  182.         SendText("\\setgrouphypertext[action= [\\load [file= ["+fn+"]]] i0= "+grp+"]");
  183.         SendText("\\setcachedownload[file= ["+DLURL+"] i0= "+grp+"]");
  184.         SendText("\\startcachedownload[i0= "+grp+"]");
  185.     }
  186.     else
  187.     {
  188.         SendText("\\load [file= ["+DLFN+"]]");
  189.     }
  190. }
  191.  
  192. function UseBackground(DLFN, code)
  193. {
  194.     if(code)
  195.     {
  196.         if    (code == "A"    )
  197.             DLURL    =    ""        + DLFN;
  198.         else if    (code == "R"    )
  199.             DLURL    =    G_PageRoot    + DLFN;
  200.         else if    (code == "DB1"    )
  201.             DLURL    =    G_DB1        + DLFN;
  202.  
  203.         fn    =    JustFile(DLFN);
  204.         grp    =    GetGrp();
  205.  
  206.         CleanUp();
  207.         SendText("\\setgrouphypertext[action= [ \\loadbackgrnd [file= ["+fn+"]]] i0= "+grp+"]");
  208.         SendText("\\setcachedownload[file= ["+DLURL+"] i0= "+grp+"]");
  209.         SendText("\\startcachedownload[i0= "+grp+"]");
  210.     }
  211.     else
  212.     {
  213.         SendText("\\loadbackgrnd [file= ["+DLFN+"]]");
  214.     }
  215. }
  216.  
  217. function UseTexture(DLFN, code)
  218. {
  219.     if(code)
  220.     {
  221.         if    (code == "A"    )
  222.             DLURL    =    ""        + DLFN;
  223.         else if    (code == "R"    )
  224.             DLURL    =    G_PageRoot    + DLFN;
  225.         else if    (code == "DB1"    )
  226.             DLURL    =    G_DB1         +DLFN;
  227.  
  228.         fn    =    JustFile(DLFN);
  229.         grp    =    GetGrp();
  230.  
  231.  
  232.         CleanUp();
  233.         SendText("\\setgrouphypertext[action= [ \\settexture [tex= ["+fn+"]]] i0= "+grp+"]");
  234.         SendText("\\setcachedownload[file= ["+DLURL+"] i0= "+grp+"]");
  235.         SendText("\\startcachedownload[i0= "+grp+"]");
  236.     }
  237.     else
  238.     {
  239.         SendText("\\settexture[tex= ["+DLFN+"]]");
  240.     }
  241. }
  242.  
  243. function UseMorph(DLFN, code)
  244. {
  245.     if(code)
  246.     {
  247.         if    (code == "A"    )
  248.             DLURL    =    ""        + DLFN;
  249.         else if    (code == "R"    )
  250.             DLURL    =    G_PageRoot    + DLFN;
  251.         else if    (code == "DB1"    )
  252.             DLURL    =    G_DB1        + DLFN;
  253.  
  254.         fn    =    JustFile(DLFN);
  255.         grp    =    GetGrp();
  256.  
  257.         SendText("\\setgrouphypertext[action= [\\load [file= ["+fn+"]]] i0= "+grp+"]");
  258.         SendText("\\setcachedownload[file= ["+DLURL+"] i0= "+grp+"]");
  259.         SendText("\\startcachedownload[i0= "+grp+"]");
  260.     }
  261.     else
  262.     {
  263.         SendText("\\setmorph[state="+DLFN+"]");
  264.     }
  265. }
  266.  
  267. function UseNaturalVoice(DLFNwav, DLFNphn, code)
  268. {
  269.     if    (code == "A"    ){
  270.         DLURLwav    =    ""        + DLFNwav;
  271.         DLURLphn    =    ""        + DLFNphn;}
  272.     else if    (code == "R"    ){
  273.         DLURLwav    =    G_PageRoot    + DLFNwav;
  274.         DLURLphn    =    G_PageRoot    + DLFNphn;}
  275.     else if    (code == "DB1"    ){
  276.         DLURLwav    =    G_DB1        + DLFNwav;
  277.         DLURLphn    =    G_DB1        + DLFNphn;}
  278.  
  279.     fnwav    =    JustFile(DLFNwav);
  280.     fnphn    =    JustFile(DLFNphn);
  281.     grp    =    GetGrp();
  282.     
  283.     SendText("\\setgrouphypertext[action= [\\load [file= ["+fnphn+"]] \\start [file=["+fnphn+"]] ] i0= "+grp+"]");
  284.     SendText("\\setcachedownload[file= ["+DLURLwav+"] i0= "+grp+"]");
  285.     SendText("\\setcachedownload[file= ["+DLURLphn+"] i0= "+grp+"]");
  286.     SendText("\\startcachedownload[i0= "+grp+"]");
  287.  
  288. }
  289.  
  290. function StartFile(thefile)
  291. {
  292.     fn    =    JustFile(thefile);
  293.  
  294.     SendText("\\start [file= ["+fn+"]]");
  295. }
  296.  
  297. function LoadFile(thefile)
  298. {
  299.     fn    =    JustFile(thefile);
  300.  
  301.     SendText("\\load [file= ["+fn+"]]");
  302. }
  303.  
  304. function GrabFile(DLFN, code)
  305. {
  306.     if    (code == "A"    )
  307.         DLURL    =    ""        + DLFN;
  308.     else if    (code == "R"    )
  309.         DLURL    =    G_PageRoot    + DLFN;
  310.     else if    (code == "DB1"    )
  311.         DLURL    =    G_DB1        + DLFN;
  312.  
  313.     fn    =    JustFile(DLFN);
  314.     grp    =    GetGrp();
  315.  
  316.     
  317.     SendText("\\setcachedownload[file= ["+DLURL+"] i0= "+grp+"]");
  318.     SendText("\\startcachedownload[i0= "+grp+"]");
  319. }
  320.  
  321.  
  322. function CleanUp(box)
  323. {
  324.     // if the box parameter is passed, it will be chosen
  325.     if(box) VFBoxSelect(box);
  326.     SendText('\\cleanup');
  327. }
  328.  
  329. //////////////////////////////////////////////////////////////
  330. // Material Properties
  331. // i0 == 0  Ambient
  332. // i0 == 1  Diffuse
  333. // i0 == 2  Emissive
  334. // i0 == 3  Specular
  335. // i0 == 4  Specular Power
  336. function SetMaterial(i0, f0, f1, f2, f3) 
  337. {
  338.     SendText("\\setmaterial[i0= " + i0 + " r= " + f0 + " g= " + f1 +" b= " + f2 + "  a= " + f3 + " ]");
  339. }
  340.  
  341. function SetAmbient(r, g, b, a)
  342. {
  343.     SetMaterial(0, r, g, b, a);
  344. }
  345.  
  346. function SetDiffuse(r, g, b, a)
  347. {
  348.     SetMaterial(1, r, g, b, a);
  349. }
  350.  
  351. function SetEmissive(r, g, b, a)
  352. {
  353.     SetMaterial(3, r, g, b, a);
  354. }
  355.  
  356. function SetSpecular(r, g, b, a)
  357. {
  358.     SetMaterial(2, r, g, b, a);
  359. }
  360.  
  361. function SetSpecularPower(power)
  362. {
  363.     SetMaterial(4, power, power, power, power);
  364. }
  365.  
  366. function Rotate(x, y, z, t)
  367. {
  368.   SendText("\\rotate[ x="+x+" y="+y+" z="+z+" t="+t+"]");
  369. }
  370.  
  371.  
  372. function Translate(x, y, z, t)
  373. {
  374.   SendText("\\translate[ x="+x+" y="+y+" z="+z+" t="+t+"]");
  375. }
  376.  
  377. function AddInitFile(box, name)
  378. {
  379.     var loadtext = '\\load [file= '+name+']';
  380.  
  381.     var     load = Backslashify('SendText(\''+loadtext+'\');');
  382.     var      set = Backslashify('VFBoxSelect('+box+');');
  383.  
  384.     G_HAPInitCommands[G_HAPInitCommandsIndex++]=set;
  385.     G_HAPInitCommands[G_HAPInitCommandsIndex++]=load;
  386. }
  387.  
  388. function AddToInitQueue(string, box)
  389. {
  390.         // if a box is selected, it will remain selected after this command
  391.     if(box) G_HAPInitCommands[G_HAPInitCommandsIndex++]='VFBoxSelect('+box+');';
  392.     G_HAPInitCommands[G_HAPInitCommandsIndex++]=string;
  393. }
  394.  
  395. function HAPOnLoadInit()
  396. {
  397.     G_HAPInitInterval = setInterval('HAPOnLoadInit_hidden();', G_HAPInitIntervalTime);
  398. }
  399.  
  400. ///////////////////////////////////////////////////////////////////////
  401. //     EVERYTHING BELOW THIS BOX IS NOT USEFUL TO A WEB DESIGNER     //
  402. ///////////////////////////////////////////////////////////////////////
  403.  
  404. ///////////////////////////////////////////////////////////////////////
  405. // HAPOnLoadInit_hidden()
  406. // HEY! Don't look at this function =), it's called by HAPOnLoadInit()
  407. // It evaluates the onload javascript functions
  408.  
  409. function HAPOnLoadInit_hidden()
  410. {
  411.     clearInterval(G_HAPInitInterval);
  412.  
  413.     for(i = 0; i <= G_HAPInitCommandsIndex; i++)
  414.     {
  415.         eval(G_HAPInitCommands[i]); 
  416.     }
  417. }
  418.  
  419. //////////////////////////////////////////////////////////////
  420. // These are assistant functions
  421.  
  422. function    GetGrp()
  423. {
  424.     G_GrpNum++;
  425.     if (G_GrpNum > G_GrpMax)
  426.         G_GrpNum    =    1;
  427.     return G_GrpNum;
  428. }
  429.  
  430. function    JustPath(s)
  431. {
  432.     delimit    = "/";
  433.     sa    = s.split(delimit);
  434.     rtn    = "";
  435.     for (i = 0; i < sa.length - 1; i++)
  436.         rtn = rtn + sa[i] + delimit;
  437.     return rtn;
  438. }
  439.  
  440. function    JustFile(s)
  441. {
  442.     delimit    = "/";
  443.     sa    = s.split(delimit);
  444.     if (sa.length > 0)
  445.         rtn    = sa[sa.length - 1];
  446.     else
  447.         rtn    = s;
  448.     return rtn;
  449. }
  450.  
  451. function     Backslashify(s)
  452. {
  453.       // Regular Expression to globaly match '\'
  454.       re = /\\/gi
  455.  
  456.     // Replace / with //
  457.       rtn = s.replace(re, '\\\\');
  458.  
  459.       return rtn;
  460. }
  461.  
  462. function SafeQuery()
  463. {
  464.   // G_SafeQuery == 0 if there is no plugin
  465.   //                1 if the plugin is old
  466.   //                the version of the plugin if it has querying
  467.  
  468.   if(G_BrowserNavigator)
  469.   {
  470.     if(document.embeds['vfbox1'])
  471.     {
  472.         found = false;
  473.         for(tootoo in document.embeds['vfbox1'])
  474.         {
  475.             if(tootoo == "QueryPlugin")
  476.             {
  477.                 found = true;
  478.                 break;
  479.             }
  480.         }
  481.  
  482.         if(!found)
  483.         {
  484.             G_SafeQuery = "0";
  485.             return(false);
  486.         }
  487.         else 
  488.         {
  489.             G_SafeQuery = HapQuery("release", 1);
  490.             return(true);
  491.         }
  492.  
  493.         found = false;
  494.         for(tootoo in document.embeds['vfbox1'])
  495.         {
  496.             if(tootoo == "HyperText")
  497.             {
  498.                 G_SafeQuery = "1";
  499.                 break;
  500.             }
  501.         }
  502.  
  503.     }
  504.     else
  505.     {
  506.  
  507.         G_SafeQuery = "0";
  508.         return(false);
  509.     }
  510.   }
  511.   if(G_BrowserExplorer)
  512.   {
  513.     if(document.vfbox1)
  514.     { 
  515.         blah = HapQuery("release", 1);
  516.  
  517.         if(blah == "release")
  518.         {
  519.             for(tootoo in document.vfbox1)
  520.             {
  521.                 if(tootoo == "HyperText")
  522.                 {
  523.                     G_SafeQuery = "1";
  524.                     break;
  525.                 }
  526.             }
  527.             if(G_SafeQuery != "1") G_SafeQuery = "0";
  528.             return(false);
  529.         }
  530.         else G_SafeQuery = blah;
  531.     }
  532.     else
  533.     {
  534.         G_SafeQuery = "0";
  535.         return(false);
  536.     }
  537.   }
  538.   return(true);
  539. }
  540.  
  541. <!--
  542. /////////////////////////
  543. // Global Variables
  544. /////////////////////////
  545. var    G_DownloadName        =    "VirtualFriend 3";
  546. var    G_Platform        =    "Win32";
  547. var    G_PlatformOkay        =    true;
  548. var    G_BrowserExplorer    =    false;
  549. var    G_BrowserNavigator    =    false;
  550. var    G_BrowserVersion    =    "0.0";
  551. var    G_BrowserOkay        =    false;
  552. var    G_BrowserWhyNot        =    "javascript │÷╧╓╣╩╒╧íú";
  553. var    G_PluginOkay        =    false;
  554. var    G_PluginWhyNot        =    "─·├╗╙╨░▓╫░ " + G_DownloadName + "íú";
  555. var    G_PluginName        =    "VirtualFriend Plugin";
  556. var    G_PluginNameOld        =    "HelloWorld Example Plugin";
  557. var    G_ErrorHandlerOrig    =    null;
  558. var    G_PluginNum        =    0;
  559. var    G_PluginCurrent        =     0;
  560. var     G_PageRoot        =    JustPath(document.location.toString());
  561. var     G_DB1            =    "http://www.haptek.com/db1/";
  562. var     G_GrpNum        =    1;
  563. var     G_GrpMax        =    100;
  564. var    G_VFBoxes        =    new Array;    
  565. var    G_VFBoxSizeX        =    150;
  566. var    G_VFBoxSizeY        =    150;
  567. var     G_Debugger        =     false;
  568. var    G_SafeQuery        =    "0";
  569. var    G_HAPInitInterval;
  570. var    G_HAPInitIntervalTime    =    2000;
  571. var     G_HAPInitCommands     =     new Array;
  572. var     G_HAPInitCommandsIndex     =     0;
  573. var    G_HAP_LangPose        =    "data\\\\standard\\\\standardPose.hap";
  574. var     G_HAP_LangScene        =    "data\\\\standard\\\\standardScene.hap";
  575. var    G_HAPCLSID        =    "CLSID:C6DC0AE5-A7BE-11D2-BDF1-0090271F4931";
  576. var    G_HAPMimeType        =    "fake/mime-type";
  577. var    G_AXCTRL        =    "ACTIVEHAPTEKX.ActiveHaptekXCtrl.1";
  578. var    G_HAPVFLanguage;    // Reserved for Language support
  579. var    G_NoVF3Image;
  580.  
  581. if(G_HAPVFLanguage == null)
  582. {
  583. }
  584. else if (G_HAPVFLanguage == "gr")
  585. {
  586.   var    G_HAP_LangPose        =    "data\\\\standard\\\\standardPose.hap";
  587.   var     G_HAP_LangScene        =    "data\\\\standard\\\\standardScene_gr.hap";
  588.   var    G_HAPCLSID        =    "CLSID:398F2883-561D-11D3-BDF1-0090272A6ABE";
  589.   var    G_HAPMimeType        =    "fake/mime-gr";
  590.   var    G_AXCTRL        =    "ACTIVEHAPTEKXGR.ActiveHaptekXCtrl.1";
  591. }
  592.  
  593.  
  594. ///////////////////////////////////////////////////////////////////////////////////////////
  595. // Detection Script
  596. // These routines check for the plugin, browser and platform.
  597.  
  598. /////////////////
  599. // DETECT BROWSER
  600.  
  601. MinimalVersionNN    =    "4.03";
  602. MinimalVersionIE    =    "4.0";
  603.  
  604. G_BrowserVersion    =    navigator.appVersion;
  605. G_Platform        =    navigator.platform;
  606.  
  607. if (navigator.appName == "Netscape") {
  608.     navigator.plugins.refresh();
  609.     G_BrowserNavigator    =    true;
  610.     if (G_BrowserVersion    <    MinimalVersionNN) {
  611.         G_BrowserOkay    =    false;
  612.         G_BrowserWhyNot    =    "─·╡─Σ»└└╞≈╠½╛╔íú─·╓┴╔┘╨Φ╥¬ Navigator " + MinimalVersionNN + "ú¼─·╒²╘┌╩╣╙├╡─╩╟ " + G_BrowserVersion + "íú";
  613.         }
  614.     else
  615.         G_BrowserOkay    =    true;
  616.     }
  617. else {
  618.     G_BrowserExplorer    =    true;
  619.     if (G_BrowserVersion    <    MinimalVersionIE) {
  620.         G_BrowserOkay    =    false;
  621.         G_BrowserWhyNot    =    "─·╡─Σ»└└╞≈╠½╛╔íú─·╓┴╔┘╨Φ╥¬ Explorer " + MinimalVersionIE + "ú¼─·╒²╘┌╩╣╙├╡─╩╟ " + G_BrowserVersion + "íú";
  622.         }
  623.     else
  624.         G_BrowserOkay    =    true;
  625.     }
  626.  
  627. if (G_Platform != "Win32") {
  628.     G_PlatformOkay    =    false;
  629.     G_BrowserOkay    =    false;
  630.     G_BrowserWhyNot    =    "╒Γ╜÷╘┌ Windows 95íó98íó║═ NT ╓╨╓┤╨╨íú";
  631.     }
  632.  
  633. // END OF BROWSER DETECTION JAVASCRIPT
  634. // -->
  635. <!--
  636.  
  637. ///////////////////////
  638. // CUSTOM ERROR HANDLER
  639. // This is used to supress the 
  640. // "Automation Server can't create object"
  641. // message box from IE.
  642.  
  643. function ErrorHandler1(msg, url, line)
  644.         {
  645.     if (msg    == "Automation server can't create object")
  646.         return true;
  647.     else
  648.         return false;
  649.     }
  650.  
  651.  
  652. ////////////////////
  653. // CHECK FOR PLUGIN
  654. if (G_BrowserOkay && G_PlatformOkay) {
  655.     if (G_BrowserExplorer) {
  656.  
  657.         //////////////////////////////////////
  658.         // DETECT PLUGIN IN EXPLORER
  659.         //
  660.         G_ErrorHandlerOrig    =    onerror;
  661.         onerror            =    ErrorHandler1;
  662.  
  663.         // IMPORTANT! If the following line generates an error,
  664.         // it will indeed get "handled" by ErrorHandler1,
  665.         // but execution of this script will terminate!
  666.         // That is, execution will resume with the next <SCRIPT>.
  667.  
  668.         // Create default (error present) settings.
  669.         G_PluginOkay    =    true;
  670.         G_PluginWhyNot    =    "─·├╗╙╨░▓╫░ " + G_DownloadName + "íú"
  671.         MyObject    =    new    ActiveXObject(G_AXCTRL);
  672.  
  673.           if (MyObject) {
  674.             // If the code gets past the above line,
  675.             // we know it will also get to here.
  676.             G_PluginOkay    =    true;
  677.             delete MyObject;
  678.               }
  679.           else {
  680.             // This will not ever be called.
  681.               }
  682.         }
  683.     else {
  684.         //////////////////////////////////////
  685.         // DETECT PLUGIN IN NETSCAPE
  686.         //
  687.         if (navigator.plugins[G_PluginName] || navigator.plugins[G_PluginNameOld]) {
  688.             G_PluginOkay    =    true;
  689.             }
  690.         else {
  691.             G_PluginOkay    =    false;
  692.             G_PluginWhyNot    =    "─·├╗╙╨░▓╫░ " + G_DownloadName + "íú"
  693.             }
  694.         }
  695.     }
  696. else {
  697.     G_PluginOkay    =    false;
  698.     G_PluginWhyNot    =    "▓╗─▄╩╣╙├ VirtualFriend 3ú¼╥≥╬¬ " + G_BrowserWhyNot;
  699.     }
  700.  
  701. // END OF PLUGIN DETECTION SCRIPT
  702. // -->
  703. <!--
  704. // RESTORE THE OLD ERROR HANDLER.
  705.  
  706. onerror    =    G_ErrorHandlerOrig;
  707.  
  708. // -->
  709.